<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<link href="media/css/news.css" rel="stylesheet" type="text/css"/>

<div class="row-fluid">
    <div class="span12">
        <h2 class="page-title">
            <div class="alert">
                欢迎使用科级管理人员个人有关事项报告管理系统
            </div>
        </h2>
    </div>
</div>
<div class="row-fluid">
    <div class="span12">
        <div style="height: auto;" id="basic-info" class="accordion collapse">
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="icon-cogs"></i>基本信息</div>
                    <div class="actions">
                        <button class="btn light-blue" id="edit-info-btn"><i class="icon-edit"></i> 编辑</button>
                        <button class="btn light-blue" id="save-info-btn"><i class="icon-plus"></i> 保存</button>
                    </div>
                </div>
                <div class="portlet-body">
                    <form action="#" class="horizontal-form" id="basic_info_form">
                        <div class="row-fluid">
                            <div class="span12">
                                <div class="span4 ">
                                    <a href="#" class="btn dark-grey disabled">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</a><input class="span8 m-wrap" type="text" placeholder="${user.C_USERNAME}" disabled />
                                </div>
                                <div class="span4 ">
                                    <a href="#" class="btn dark-grey disabled">民&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;族</a><input class="span8 m-wrap" type="text" placeholder="${user.NATION}" disabled />
                                </div>
                                <div class="span4 ">
                                    <a href="#" class="btn dark-grey disabled">职工编号</a><input class="span8 m-wrap" type="text" placeholder="${user.TGCARDNO}" disabled />
                                </div>
                            </div>
                        </div>
                        <div class="row-fluid">
                            <div class="span12">
                                <div class="span4">
                                    <a href="#" class="btn dark-grey disabled">身份证号</a><input class="span8 m-wrap" type="text" placeholder="${user.IDCARDNO}" disabled />
                                    <input class="hidden" name="comfirm-flag" id="confirm-flag" value="${flag}">
                                </div>
                                <div class="span4">
                                    <a href="#" class="btn dark-grey disabled">户籍地址</a><input class="span8 m-wrap" type="text" name="ADDRESS" id="huji" value="${user.ADDRESS}" disabled/>
                                </div>
                                <div class="span4">
                                    <a href="#" class="btn dark-grey disabled">职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;级</a><input class="span8 m-wrap" type="text" name="CLASSES" id="zhiji" value="${user.CLASSES}" disabled/>
                                </div>
                            </div>
                        </div>
                        <div class="row-fluid">
                            <div class="span12">
                                <div class="span4">
                                    <a href="#" class="btn dark-grey disabled">工作单位</a><input class="span8 m-wrap" name="C_DEPTID" id="deptid" value="${user.C_DEPTID}" disabled/>
                                    <input class="hidden" name="C_USERID"  value="${user.C_USERID}" />
                                </div>
                                <div class="span4">
                                    <a href="#" class="btn dark-grey disabled">现任职务</a><input class="span8 m-wrap" name="POST" id="post"  value="${user.POST}" disabled/>
                                </div>
                                <div class="span4">
                                    <a href="#" class="btn dark-grey disabled">政治面貌</a><input class="span8 m-wrap" name="POLITICALSTATUS" id="polic"  value="${user.POLITICALSTATUS}" disabled/>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div style="height: auto;" id="report-schedule" class="accordion collapse">
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="icon-cogs"></i>填报进度</div>
                </div>
                <div class="portlet-body">
                    <div class="row-fluid top-news">
                        <div class="span12">
                            <div class="span3">
                                <a href="#"  id="report-info"
                                   <c:if test="${rpt_flag==0}">class="btn blue"</c:if>
                                   <c:if test="${rpt_flag!=0}">class="btn dark-grey"</c:if> >
                                    <span>填报信息</span>
                                    <em>填报信息</em>
                                    <i class="icon-edit top-news-icon"></i>
                                </a>
                            </div>
                            <div class="span3">
                                <a href="#" id="report-upload"
                                   <c:if test="${rpt_flag==1}">class="btn blue"</c:if>
                                   <c:if test="${rpt_flag!=1}">class="btn dark-grey"</c:if>
                                >
                                    <span>提交信息</span>
                                    <em>提交信息</em>

                                    <i class="icon-arrow-up top-news-icon"></i>
                                </a>
                            </div>
                            <div class="span3">
                                <a href="#" id="report-reinfo"
                                   <c:if test="${rpt_flag==2}">class="btn blue"</c:if>
                                   <c:if test="${rpt_flag!=2}">class="btn dark-grey"</c:if>
                                >
                                    <span>信息审核</span>
                                    <em>信息审核</em>
                                    <i class="icon-sitemap top-news-icon"></i>
                                </a>
                            </div>
                            <div class="span3">
                                <a href="#"
                                   <c:if test="${rpt_flag==3}">class="btn blue"</c:if>
                                   <c:if test="${rpt_flag!=3}">class="btn dark-grey"</c:if>
                                >
                                    <span>信息驳回</span>
                                    <em>信息驳回</em>
                                    <i class="icon-book top-news-icon"></i>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $('#edit-info-btn').on('click',function(){
        $("#huji").removeAttr("disabled");
        $("#zhiji").removeAttr("disabled");
        $("#deptid").removeAttr("disabled");
        $("#post").removeAttr("disabled");
        $("#polic").removeAttr("disabled");
    })
</script>

<script>
    $('#save-info-btn').on('click',function(){
        $.ajax({
            type : 'POST',
            url : 'editSave',
            data : $('#basic_info_form').serialize(),
            async : true,
            success : function(){
                $("#huji").attr("disabled","disabled");
                $("#zhiji").attr("disabled","disabled");
                $("#deptid").attr("disabled","disabled");
                $("#post").attr("disabled","disabled");
                $("#polic").attr("disabled","disabled");
            }
        })
    })
</script>